package chap04.Queue;

import java.util.Queue;
import java.util.concurrent.ArrayBlockingQueue;

/**
 * Created by root on 2017/6/30.
 */


public class QueueApp {

    public static void main(String[] args) {
        QueueX queueX = new QueueX(5);
        queueX.insert(20);
        queueX.insert(40);
        queueX.insert(60);
        queueX.insert(80);
        queueX.insert(90);
        queueX.insert(100);


        while (!queueX.isEmpty()) {
            long value = queueX.remove();
            System.out.print(value);
            System.out.print(" ");
        }

        System.out.println("");
        queueX.insert(2);
        queueX.insert(4);
        queueX.insert(6);
        queueX.insert(8);
        while (!queueX.isEmpty()) {
            long value = queueX.remove();
            System.out.print(value);
            System.out.print(" ");
        }
    }
}
